package com.imooc.reward.config;

import com.imooc.reward.service.OrderMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * ProjectName order
 *
 * @author xieyucan
 * <br>CreateDate 2022/9/20 16:20
 */
@Configuration
public class RabbitConfig {

    @Autowired
    OrderMessageService orderMessageService;


    /**
     *  @Autowired 添加之后，表明这个方法需要自动执行
     * @throws IOException
     * @throws TimeoutException
     */
    @Autowired
    public void startListenMessage() throws IOException, TimeoutException {
        orderMessageService.handleMessage();
    }
}
